#!/bin/bash

echo "🚀 启动企洺星官网项目（简化版）..."

# 停止现有服务
echo "🛑 停止现有服务..."
docker-compose -f docker-compose-simple.yml down

# 启动基础服务
echo "📦 启动基础服务（MySQL + Redis）..."
docker-compose -f docker-compose-simple.yml up -d

# 等待数据库启动
echo "⏳ 等待数据库启动..."
sleep 10

# 检查服务状态
echo "🔍 检查服务状态..."
docker ps

echo ""
echo "✅ 基础服务启动完成！"
echo ""
echo "🌐 访问地址："
echo "   数据库：localhost:3306"
echo "   缓存：localhost:6379"
echo ""
echo "📊 默认账号："
echo "   数据库：root / root123456"
echo "   数据库名：qimingxing_website"
echo ""
echo "📝 查看日志："
echo "   docker logs qimingxing_mysql"
echo "   docker logs qimingxing_redis"
echo ""
echo "🛑 停止服务："
echo "   docker-compose -f docker-compose-simple.yml down"
echo ""
